/*
 *  dna_netmgr.h -- provide dna-system network management.
 *  
 *  ORIGINAL AUTHOR: Xu Chun (chun.xu@broadlink.com.cn)
 *
 *  Copyright (c) 2016 Broadlink Corporation
 */

#ifndef __DNA_NETMGR_H
#define __DNA_NETMGR_H

#ifdef __cplusplus
    extern "C" {
#endif

/* dna-system network status code */
typedef enum {
    DNA_NETWORK_DEIN                 = 0,
    DNA_NETWORK_INIT,
    DNA_NETWORK_ASSO_FAIL,
    DNA_NETWORK_AUTH_FAIL,
    DNA_NETWORK_CONFIG_SMARTCONFIG,
    DNA_NETWORK_CONFIG_AP,
    DNA_NETWORK_CONNECTING,
    DNA_NETWORK_CONNECTED,
    DNA_NETWORK_MGR_IDLE,
    DNA_NETWORK_CLOUDLINK,
} dna_network_status_e;

/*
*  dna-system network status set interface.
*/
void dna_network_status_set(int status);

/*
*  dna-system network status get interface.
*/
int dna_network_status_get(void);

/*
*  dna-system load network information.
*/
int dna_load_network(dna_wifi_network_t * network);

/*
*  dna-system save network information.
*/
int dna_save_network(dna_wifi_network_t * network);

/*
*  dna-system delete network information.
*/
int dna_delete_network(void);

/* 
*  dna-system network framework initialization.
*
*  This interface depends on two API (user implemented):
*  1) module_network_config
*  2) module_network_handle
*
*  Return 0 means initialize success, if return -1 means occurred error.
*/
int dna_network_init(void);

#ifdef __cplusplus
}
#endif

#endif

